package com.hmall.search.web;

import com.hmall.common.dto.FiltersDTO;
import com.hmall.common.dto.FiltersVO;
import com.hmall.common.dto.Item;
import com.hmall.common.dto.PageDTO;
import com.hmall.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO
 *
 * @Author anjing
 * @Date 2024/11/15 10:37
 */
@RestController
@RequestMapping("search")
public class searchController {
    @Autowired
    private SearchService searchService;
    @PostMapping("/filters")
    public FiltersVO filterss(@RequestBody FiltersDTO filtersDTO){

       return searchService.filterss(filtersDTO);
    }

    @PostMapping("/list")
    public PageDTO<Item> queryList(@RequestBody FiltersDTO filtersDTO){

       PageDTO<Item> pageDTO =searchService.list1(filtersDTO);
        return pageDTO;
    }



}
